<%@ page import="com.mastercard.labs.Transaction" %>



<div class="fieldcontain ${hasErrors(bean: transactionInstance, field: 'amount', 'error')} required">
	<label for="amount">
		<g:message code="transaction.amount.label" default="Amount" />
		<span class="required-indicator">*</span>
	</label>
	<g:field type="number" name="amount" required="" value="${fieldValue(bean: transactionInstance, field: 'amount')}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: transactionInstance, field: 'card', 'error')} required">
	<label for="card">
		<g:message code="transaction.card.label" default="Card" />
		<span class="required-indicator">*</span>
	</label>
	<g:select id="card" name="card.id" from="${com.mastercard.labs.Card.list()}" optionKey="id" required="" value="${transactionInstance?.card?.id}" class="many-to-one"/>
</div>

<div class="fieldcontain ${hasErrors(bean: transactionInstance, field: 'currency', 'error')} ">
	<label for="currency">
		<g:message code="transaction.currency.label" default="Currency" />
		
	</label>
	<g:textField name="currency" value="${transactionInstance?.currency}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: transactionInstance, field: 'description', 'error')} ">
	<label for="description">
		<g:message code="transaction.description.label" default="Description" />
		
	</label>
	<g:textField name="description" value="${transactionInstance?.description}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: transactionInstance, field: 'merchant', 'error')} required">
	<label for="merchant">
		<g:message code="transaction.merchant.label" default="Merchant" />
		<span class="required-indicator">*</span>
	</label>
	<g:select id="merchant" name="merchant.id" from="${com.mastercard.labs.Merchant.list()}" optionKey="id" required="" value="${transactionInstance?.merchant?.id}" class="many-to-one"/>
</div>

<div class="fieldcontain ${hasErrors(bean: transactionInstance, field: 'txnDate', 'error')} required">
	<label for="txnDate">
		<g:message code="transaction.txnDate.label" default="Txn Date" />
		<span class="required-indicator">*</span>
	</label>
	<g:datePicker name="txnDate" precision="day"  value="${transactionInstance?.txnDate}"  />
</div>

<div class="fieldcontain ${hasErrors(bean: transactionInstance, field: 'type', 'error')} ">
	<label for="type">
		<g:message code="transaction.type.label" default="Type" />
		
	</label>
	<g:textField name="type" value="${transactionInstance?.type}"/>
</div>

